package kuzha.ast;

public class WhileStatement extends BlockStatement {
	public final Expression cond;
	public final Statement body, _else;
	
	public WhileStatement(Expression cond, Statement body, Statement _else) {
		if (cond == null || body == null)
			throw new IllegalArgumentException();
		this.cond = cond;
		this.body = body;
		this._else = _else;
	}
	
	@Override
	public void accept(AstVisitor visitor) {
		visitor.visit(this);
	}
	@Override
	public <A, R> R accept(AstVisitor2<A, R> visitor, A object) {
		return visitor.visit(this, object);
	}
}
